Skip to content

interconnect/axi: map from one address space to another - #1522

Closed
mkuhn99 wants to merge 1 commit into
enjoy-digital:masterfrom
mkuhn99:master
Closed

interconnect/axi: map from one address space to another#1522
mkuhn99 wants to merge 1 commit into
enjoy-digital:masterfrom
mkuhn99:master

Conversation

@mkuhn99

@mkuhn99 mkuhn99 commented Nov 28, 2022

Copy link
Copy Markdown
Contributor

When trying to connect to the PS axi gp slave to the main Bus of the LiteX SoC I came across the problem that the address space of the zybo PS and the address space/memory map of the Litex SoC are conflicting.
To solve this problem I added the connect_mapped function to the AXIInterface, which applies a function to the address signals before connecting the two interfaces together.

Such a function would, for example, add or subtract an offset.

@mkuhn99

mkuhn99 commented Nov 28, 2022

Copy link
Copy Markdown
Contributor Author

Here is a case where one would/could use this function.

@enjoy-digital

Copy link
Copy Markdown
Owner

Thanks @mkuhn99, this is indeed interesting and I understand the need. Please just give me some time to think about it.

@enjoy-digital

Copy link
Copy Markdown
Owner

This has now been handled with a structured remapping path:

  • 39390177c adds src_regions / dst_regions support to AXI and AXI-Lite remappers.
  • 2a5ce7859 adds AXI/AXI-Lite regression coverage for region remapping.
  • a0dc61851 adds the higher-level SoCBusHandler.add_slave(..., dst_region=...) API.

This allows a LiteX-visible decode region to differ from the downstream/external bus address window, for example:

self.bus.add_slave(
    name       = "ps_io",
    slave      = axi_ps,
    region     = SoCRegion(origin=0x6000_0000, size=0x0030_0000),
    dst_region = SoCRegion(origin=0xe000_0000, size=0x0030_0000),
)

So the Zynq/PS-style remapping use case can now be expressed directly at the SoC bus level, without adding an arbitrary address callback to the low-level AXI connect() helper. The existing strip_origin behavior is kept unchanged as the map-to-zero special case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants